package com.usian.service.impl;



import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.usian.common.Result;
import com.usian.mapper.CityMapper;
import com.usian.pojo.City;
import com.usian.pojo.User;
import com.usian.pojo.vo.LoginReqVo;
import com.usian.service.CityService;
import com.usian.service.IUserService;
import org.springframework.stereotype.Service;
;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Service
public class CityServiceImpl extends ServiceImpl<CityMapper, City> implements CityService {



    @Override
    public boolean updateCity(City city) {
        return baseMapper.updateById(city) > 0;
    }

    @Override
    public boolean deleteCity(Integer id) {
        return baseMapper.deleteById(id) > 0;
    }

    @Override
    public Result findList() {
        List<City> list = baseMapper.selectList(null);
        return Result.ok(list);
    }

    @Override
    public Result add(City city) {
        city.setStatus("暂停服务");
        city.setUpdateTime(new Date());
        this.baseMapper.insert(city);
        return Result.ok();
    }
}